<?php

// 交易区
Route::get('markets', 'CommonController@markets');
// 交易对
Route::get('symbols', 'CommonController@symbols');
// v2交易对
Route::get('symbols/v2', 'CommonController@symbolV2');
// 热门搜索币种
Route::get('hot_coin', 'CommonController@hotCoin');
// 行情列表
Route::get('tickers', [
    'as' => 'api.spot.tickers',
    'uses' => 'CommonController@tickers'
]);
// 币种
Route::get('currencies', 'CommonController@currencies');
// 币种简介
Route::get('introduce', 'CommonController@introduce');

// 最近成交
Route::get('market/trades', [
    'as' => 'api.spot.trades',
    'uses' => 'MarketController@trades',
]);
// 市场深度
Route::get('market/depth', 'MarketController@depth');
// K线
Route::get('market/kline', 'MarketController@kline');
// 最后一根K线
Route::get('market/last_kline', 'MarketController@lastKline');

Route::middleware(['auth:api'])->group(function () {
    // 订单列表
    Route::get('orders', 'OrderController@index');
    // 交易详情
    Route::get('orders/{order}', 'OrderController@show')
        ->where('order', '[0-9]+');
    // 创建订单
    Route::post('orders', 'OrderController@store');
    // 撤销单个订单
    Route::delete('orders/{order}', 'OrderController@cancel')
        ->where('order', '[0-9]+');
    // 撤销全部订单
    Route::delete('orders/all', 'OrderController@cancelAll');
    // 成交记录
    Route::get('trades', 'TradeController@index');

    // 自选
    Route::post('symbol', 'OrderController@symbol');
    // 自选列表
    Route::get('my_symbol', 'OrderController@mySymbol');
});
